from django.db import models
from apps.common.base.models import BaseModel
from apps.system.lessee.models import Lessee

class Spec(BaseModel):
    status = (
        (0, "关闭"),
        (1, "正常"),
    )
    lessee = models.ForeignKey(Lessee, related_name='lessee_spec', verbose_name='租户',
                                 on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)

    name = models.CharField("名称", max_length=200, blank=True)
    otherName = models.CharField("别名", max_length=200, blank=True)
    values = models.CharField("规格值", max_length=1000, blank=True)
    status = models.IntegerField("状态", choices=status, default=1)

    class Meta:
        verbose_name = 'Spec'
        verbose_name_plural = verbose_name
